import 'package:flutter/material.dart';
import 'package:untitled/pages/home/tab_search/data_list.dart';
import 'package:untitled/pages/home/tab_search/filter_bar/filter_drawer.dart';
import 'package:untitled/pages/home/tab_search/filter_bar/index.dart';
import 'package:untitled/widgets/room_list_item_widget.dart';
import 'package:untitled/widgets/search_bar/index.dart';

/*
* 找房Tab
* */
class TabSearch extends StatefulWidget {
  const TabSearch({Key key}) : super(key: key);

  @override
  _TabSearchState createState() => _TabSearchState();
}

class _TabSearchState extends State<TabSearch> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      endDrawer: FilterDrawer(),
      appBar: AppBar(
        actions: [Container()],
        elevation: 0,//去掉AppBar下面的阴影
        title: SearchBar(
          showLocation: true,
          showMap: true,
          onSearch: () {
            Navigator.of(context).pushNamed('search');
          },
        ),
        backgroundColor: Colors.white,
      ),
      body: Column(
        children: [
          FilterBar(
            onChange: (data) {

            },
          ),
          Expanded(
              child: ListView(
            children: dataList.map((e) => RoomListItemWidget(e)).toList(),
          ))
        ],
      ),
    );
  }
}
